package com.ruoyi.wallet.api;

import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.wallet.api.domain.ErpDistributionUserWallet;
import com.ruoyi.wallet.api.domain.ErpSellerStoreWallet;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

import java.math.BigDecimal;

@FeignClient(contextId = "remoteWalletService", value = ServiceNameConstants.WALLET_SERVICE)
public interface RemoteWalletService {

    /**
     * 修改钱包的金额
     *
     * @return
     */
    @GetMapping("/seller/sellerStoreWallet/updateWallet/{flowType}/{expenseType}/{payType}/{money}/{sellerId}/{orderNo}/{remark}")
    R<Object> updateWallet(@PathVariable("flowType") Integer flowType,@PathVariable("expenseType") Integer expenseType,
                           @PathVariable("payType") Integer payType, @PathVariable("money") BigDecimal money,
                           @PathVariable("sellerId") Long sellerId,@PathVariable("orderNo") String orderNo,
                           @PathVariable("remark") String remark);

    /**
     * 初始化钱包并获得钱包信息
     * @param userId 用户
     * @return wallet
     * 4.0.0以后废弃
     */
//    @GetMapping("/seller/sellerStoreWallet/initWallet/{userId}")
//    ErpSellerStoreWallet initWallet(@PathVariable("userId") Long userId);


    /**
     * @Description: 初始化钱包并获得钱包信息
     * @Author: j.zh
     * @Date: 2024/5/2
     * @param distributionUserId
     * @param userId
     * @param source
     * @return com.ruoyi.wallet.api.domain.ErpSellerStoreWallet
     * @Version: 4.0.0
    **/
    @GetMapping("/distribution/wallet/init/{distributionUserId}/{userId}")
    ErpSellerStoreWallet initWallet(@PathVariable("distributionUserId") Long distributionUserId,
                                    @PathVariable("userId") Long userId,
                                    @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/distribution/wallet/getWalletByUserId/{userId}")
    ErpDistributionUserWallet getWalletByUserId(@PathVariable("userId") Long userId);
}
